/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'
import ModuleLayout from '@/layout/module'

const commodityRouter = {
  path: '/commodity',
  component: Layout,
  redirect: '/commodity/default',
  name: 'Commodity',
  meta: {
    title: '商品',
    icon: 'em-icon-shangpin4'
  },
  children: [
    {
      path: '/commodity/default',
      component: ModuleLayout,
      name: 'CommodityIndex',
      redirect: '/commodity/default/index',
      meta: {
        title: '商品管理',
        icon: 'em-icon-list'
      },
      children: [
        {
          path: '/commodity/default/index',
          component: () => import('@/views/commodity/index'),
          meta: {
            title: '列表',
            keepAlive: true
          },
          hidden: true
        },
        {
          path: '/commodity/default/create',
          component: () => import('@/views/commodity/update/create'),
          name: 'commodity/create',
          meta: {
            title: '添加商品'
          },
          hidden: true
        },
        {
          path: '/commodity/default/update/:id',
          component: () => import('@/views/commodity/update/index'),
          name: 'commodity/default/update/:id',
          meta: {
            title: '修改商品'
          },
          hidden: true
        },
        {
          path: '/commodity/default/view/:id',
          component: () => import('@/views/commodity/view'),
          name: 'commodity/default/view/:id',
          meta: {
            title: '详情'
          },
          hidden: true
        },
        {
          path: '/commodity/default/skus/:id',
          component: () => import('@/views/commodity/update/skus'),
          name: 'commodity/default/skus/:id',
          meta: {
            title: '规格设置'
          },
          hidden: true
        }
      ]
    },
    {
      path: '/commodity/params',
      name: 'CommodityParams',
      component: ModuleLayout,
      redirect: '/commodity/params/index',
      meta: {
        title: '商品参数',
        icon: 'em-icon-slider'
      },
      children: [
        {
          path: '/commodity/params/index',
          component: () => import('@/views/commodity/params/index'),
          name: 'CommodityParamsIndex',
          hidden: true
        }
      ]
    },
    // {
    //   path: '/commodity/type',
    //   component: () => import('@/views/commodity/type'),
    //   name: 'CommodityType',
    //   meta: {
    //     title: '店内分类',
    //     icon: 'em-icon-apps'
    //   }
    // },
    {
      path: '/commodity/album',
      // component: () => import('@/views/commodity/album/index'),
      component: ModuleLayout,
      redirect: '/commodity/album/index',
      name: 'CommodityAlbum',
      meta: {
        title: '相册管理',
        icon: 'em-icon-album'
      },
      children: [
        {
          path: '/commodity/album/index',
          component: () => import('@/views/commodity/album/index'),
          name: 'CommodityAlbumIndex',
          meta: {
            title: '列表',
            keepAlive: true
          },
          hidden: true
        },
        {
          path: '/commodity/album/:id',
          component: () => import('@/views/commodity/album/view'),
          name: 'CommodityAlbumView',
          meta: {
            title: '详情'
          },
          hidden: true
        }
      ]
    }
  ]
}
export default commodityRouter
